package cn.edu.lit.jsjxy.CourseExample.chapter3;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import cn.edu.lit.jsjxy.CourseExample.R;


public class SecondActivity extends Activity implements View.OnClickListener
{

    String username;
    TextView tv2;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);

        tv2 = findViewById(R.id.tv2);

        Intent intent = getIntent();

//        username = intent.getStringExtra("username");


        Bundle bundle = intent.getExtras();

        username = bundle.getString("username");

        //
        //
        //        findViewById(R.id.tv2).setOnClickListener(this);
        tv2.setText(username);

    }

    @Override
    public void onClick(View view)
    {
        //Toast.makeText(this,username,Toast.LENGTH_SHORT).show();
    }
}
